import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '加入时间',
		align: "center",
		dataIndex: 'createTime'
	},
	{
		title: '昵称',
		align: "center",
		dataIndex: 'nickName'
	},
	{
		title: '手机号',
		align: "center",
		dataIndex: 'phone'
	},
	{
		title: '头像',
		align: "center",
		dataIndex: 'img',
		customRender: render.renderImage,
	},
	{
		title: '真实姓名',
		align: "center",
		dataIndex: 'userName'
	},
	{
		title: '性别',
		align: "center",
		dataIndex: 'sex_dictText'
	},
	{
		title: '城市',
		align: "center",
		dataIndex: 'city',
		customRender: ({ text }) => {
			return render.renderCategoryTree(text, '')
		},
	},
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText'
	},
	
	
	{
		title: '累计消费金额',
		align: "center",
		sorter: true,
		dataIndex: 'totalAmount'
	},
	{
		title: '累计消费次数',
		align: "center",
		sorter: true,
		dataIndex: 'totalNum'
	},
	{
		title: '标签',
		align: "center",
		dataIndex: 'tags_dictText'
	},
	{
		title: '备注',
		align: "center",
		dataIndex: 'remark'
	},


	{
		title: '年龄',
		align: "center",
		sorter: true,
		dataIndex: 'age'
	},
	/* {
		title: '身份',
		align: "center",
		dataIndex: 'identity_dictText'
	}, */
];
//查询数据
export const searchFormSchema : FormSchema[] = [
	{
		label: "昵称",
		field: "nickName",
		component: 'Input',
		//colProps: {span: 6},
	},
	{
		label: "手机号",
		field: "phone",
		component: 'Input',
		//colProps: {span: 6},
	},
	{
		label: "真实姓名",
		field: "userName",
		component: 'Input',
		//colProps: {span: 6},
	},
	{
		label: "城市",
		field: "city",
		component: 'JCategorySelect',
		componentProps: {
			pcode: "",//back和事件未添加，暂时有问题
		},
		//colProps: {span: 6},
	},
	{
		label: "租户",
		field: "tenantId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "sys_tenant,name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "学校",
		field: "schoolId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_school,title,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "备注",
		field: "remark",
		component: 'Input',
		//colProps: {span: 6},
	},

	{
		label: "性别",
		field: "sex",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sex"
		},
		//colProps: {span: 6},
	},
	/* {
		label: "身份",
		field: "identity",
		component: 'JDictSelectTag',
		componentProps: {
		},
		//colProps: {span: 6},
	}, */
];

//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '手机号',
		field: 'phone',
		component: 'Input',
	},
	{
		label: '真实姓名',
		field: 'userName',
		component: 'Input',
	},
	{
		label: '城市',
		field: 'city',
		component: 'JCategorySelect',
		componentProps: {
			pcode: "", //TODO back和事件未添加，暂时有问题
		},
	},
	{
		label: '学校',
		field: 'schoolId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_school,title,id"
		},
	},
	/* 	{
			label: '标签',
			field: 'tags',
			component: 'JSelectMultiple',
			componentProps: {
				dictCode: "sys_category,name,id"
			},
		}, */
	{
		label: '备注',
		field: 'remark',
		component: 'InputTextArea',//TODO 注意string转换问题
	},


	{
		label: '性别',
		field: 'sex',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "sex"
		},
	},
	{
		label: '年龄',
		field: 'age',
		component: 'InputNumber',
	},
	/* 	{
			label: '身份',
			field: 'identity',
			component: 'JDictSelectTag',
			componentProps: {
				dictCode: ""
			},
		}, */
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];

//子表列表数据
export const coupleLeaderContractColumns : BasicColumn[] = [
	{
		title: '签订时间',
		align: "center",
		dataIndex: 'createTime'
	},
	{
		title: '签字',
		align: "center",
		dataIndex: 'signature',
		customRender: render.renderImage,
	},
	{
		title: '合同',
		align: "center",
		dataIndex: 'contractId_dictText'
	},
	{
		title: '签订的合同',
		align: "center",
		dataIndex: 'img',
		customRender: render.renderImage,
	},
	{
		title: '领队',
		align: "center",
		dataIndex: 'leaderId_dictText'
	},
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText'
	},
];
//子表表单数据
export const coupleLeaderContractFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];
//子表列表数据
export const coupleUserFinanceColumns : BasicColumn[] = [
	{
		title: '可提现余额',
		align: "center",
		dataIndex: 'balance'
	},
	{
		title: '总佣金',
		align: "center",
		dataIndex: 'grossCommission'
	},
	{
		title: '已提现佣金',
		align: "center",
		dataIndex: 'yiCommission'
	},
	{
		title: '未提现佣金',
		align: "center",
		dataIndex: 'weiCommission'
	},
	{
		title: '总使用优惠券抵扣金额',
		align: "center",
		dataIndex: 'totalDiscountCoupon'
	},
	{
		title: '总支付金额',
		align: "center",
		dataIndex: 'totalSale'
	},
];
//子表表单数据
export const coupleUserFinanceFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];
//子表列表数据
export const coupleUserDiscountCouponColumns : BasicColumn[] = [
	{
		title: '金额',
		align: "center",
		dataIndex: 'price'
	},
	{
		title: '过期时间',
		align: "center",
		dataIndex: 'expirationTime'
	},
	{
		title: '券',
		align: "center",
		dataIndex: 'couponId_dictText'
	},
	{
		title: '使用状态',
		align: "center",
		dataIndex: 'useStatus_dictText'
	},
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText'
	},
];
//子表表单数据
export const coupleUserDiscountCouponFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
	{
		label: '券',
		field: 'couponId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_discount_coupon,title,id"
		},
	},
];
//子表列表数据
export const coupleAccountChangeRecordColumns : BasicColumn[] = [
	{
		title: '时间',
		align: "center",
		dataIndex: 'createTime'
	},
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '账变类别',
		align: "center",
		dataIndex: 'recordType_dictText'
	},
	{
		title: '变化金额',
		align: "center",
		sorter: true,
		dataIndex: 'price'
	},
	{
		title: '账变前',
		align: "center",
		sorter: true,
		dataIndex: 'changeFront'
	},
	{
		title: '变化后',
		align: "center",
		sorter: true,
		dataIndex: 'changBack'
	},
	{
		title: '变化状态',
		align: "center",
		dataIndex: 'changeStatus_dictText'
	},
	{
		title: '租户',
		align: "center",
		dataIndex: 'tenantId_dictText'
	},
];
//子表表单数据
export const coupleAccountChangeRecordFormSchema : FormSchema[] = [
	// TODO 子表隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];